package com.ds.did.didrequest;

import java.net.HttpURLConnection;
import java.net.URL;

public class DIDRequestHelper {
	 private String serverIp= null; 
		public DIDRequestHelper(String serverIp) {
			this.serverIp = serverIp;
		}
		
		 public  String[] getClientAccountData(String clientid) 
		 {
				String [] Account=null;
				
				String url = "http://"+serverIp+":8080/VMMServer/misscallClient?Keyword="+clientid;
				
						if (url != null) 
						{
							try {  
									URL codedURL = new URL(url.toString());
									HttpURLConnection HURLC = (HttpURLConnection) codedURL.openConnection();
									HURLC.setRequestMethod("GET");
									HURLC.setDoOutput(true);
									HURLC.setDoInput(true);
									HURLC.setUseCaches(false);
									HURLC.connect();
									String AccountDetails= HURLC.getHeaderField("1708");
									
									HURLC.disconnect();
									if(AccountDetails != null){
									Account=AccountDetails.split("_");
									}
									
								} catch (Exception E) {
									E.printStackTrace();
								}
							}
						return Account;
			}	
		 
		 public void getKeywordDetail(String mobileno,String msg,String msgDate)
		 {
			
			 try {
				 //Insert into table...
				 
				 
				
				
				 
			 }catch(Exception e)
				{
					e.printStackTrace();
					
				}
				finally{
					try{
							
					}catch(Exception E){
						E.printStackTrace();
					}
				}
		}

}
